<?php

namespace App\Models;

use App\Filter\BpmMaindataFilter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use EloquentFilter\Filterable;
use App\Models\User;

class BpmMaindata extends Model
{
    use HasFactory,Filterable;

    protected $connection = 'bpm_rs';

    public $timestamps = false;

    protected $table = 'bpm_maindata';

    public function modelFilter(): ?string
    {
        return $this->provideFilter(BpmMaindataFilter::class);
    }

    public function user()
    {
        return $this->hasOne(User::class,'username','WF_AddName');
    }

    public function task()
    {
        return $this->hasMany(AssessmentReqDevSplit::class,'instanceId','WF_OrUnid');
    }
}
